-
Notifications
You must be signed in to change notification settings - Fork 454
[CDRIVER-5961] [CDRIVER-2086] Renaming of binaries, packages, and install paths #1965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CDRIVER-5961] [CDRIVER-2086] Renaming of binaries, packages, and install paths #1965
Conversation
These use the TestProject module to define test cases that run a CMake build, but that CMake project uses `pkg-config` to import the libraries rather than `find_package`. This allows us to test `pkg-config` while relying on CMake to do the heavy lifting around compiler detection and search path handling.
When building a TestProject, we want to set CMAKE_PREFIX_PATH to point to the directory that received the parent project installation.
Previously, pkg-config generated a `-l` with a library stem, and it would only coincidentally name a static library with a `.a` suffix. Instead, for static libraries, specify the path to the actual static library archive file. Only rely on `-l` searching for shared libraries.
This change is BREAKING and changes the names of generated files for libbson (libmongoc TBD). - Headers are installed in a directory qualified by the project version. - The generated dynamic library has a property version suffix now (instead of 0.0.0). - We set the SOVERSION property to generate a new SONAME for the emitted bson library. - The bson-1.0 CMake packages are removed. - The pkg-config files are now named `bson1` and `bson1-static`. - Both the static and dynamic library file stems are now `libbson1` (no `-static` suffix). - The project now imports the system libbson using the name "bson" instead of `bson-1.0` (as well as the generated mongoc config-file package)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, with two small typo fixes.
src/libbson/etc/bsonConfig.cmake
Outdated
# by setting HINTS and NO_DEFAULT_PATH | ||
get_filename_component(parent_dir "${CMAKE_CURRENT_LIST_DIR}" DIRECTORY) | ||
find_dependency(bson-1.0 HINTS ${parent_dir} NO_DEFAULT_PATH) | ||
# Import the target files that will be install alongside this file. Only the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Import the target files that will be install alongside this file. Only the | |
# Import the target files that will be installed alongside this file. Only the |
set(CMAKE_MODULE_PATH "${__prev_path}") | ||
endif() | ||
|
||
# Import the target files that will be install alongside this file. Only the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Import the target files that will be install alongside this file. Only the | |
# Import the target files that will be installed alongside this file. Only the |
I vote
Adding a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with minor suggestions. I very much like the new naming scheme. I expect including the API version in the filename and include directories will help users quickly identify the version installed. The test speed-ups are also appreciated.
Refer: CDRIVER-5961
This is a follow-up to #1955 which renames many files and packages in preparation for the 2.x updates.
Summary
Renames
This changeset renames 1 the following things:
libmongoc-1.0.so.0.0.0
->libmongoc<major>.so.<major>.<minor>.<patch>
libmongoc-static-1.0.a
->libmongoc<major>.a
libbson
).dll.lib
extension instead of just.lib
. This is required to prevent filename collisions, but is also a great help when trying to figure out what's an implib and what's an actual static library archive.libmongoc-1.0
->mongoc<major>
libbson-1.0
->bson<major>
bson_static
,mongoc_shared
, etc. have not been renamed, but in-project aliases (bson::static
,mongoc::shared
) have been added to match the export names of those targets in the CMake package files. References to the internal targets should use the new name whenever possible.CMAKE_INSTALL_INCLUDEDIR
(e.g.bson-<major>.<minor>.<patch>
.Removals
The following items have been removed:
bson-1.0
andmongoc-1.0
CMake config-file packages are completely removed. We now rely on the config-file packages that were added in [CDRIVER-5931] New forward-compatible CMake package files #1955, which now own the exported CMake targets directly..modulemap
files.libmongoc-ssl-1.0
pkg-config file is deleted.Other Bits
pkg-config
to import the project. There have been tests for this for a while, but they turn out to be extremely fragile to file renaming, and ran very slowly.VERSION_CURRENT
to know the names of packages and files that will be installed. This will be required for a smooth transition when the major version is bumped.MONGO_C_DRIVER_INSTALL_CMAKEDIR
. This is based on theGNUInstallDirs
variables. The package directories are further controllable withBSON_INSTALL_CMAKEDIR
andMONGOC_INSTALL_CMAKEDIR
, which default to<prefix>/<infix>/<package-name>-<version>
.Pending
The following open questions remain:
mongoc-stat
binary to<prefix>/bin
. If we support installing more than one major version, then major versions will fight over who owns this file. Should rename tomongoc<major>-stat
?mongoc-static-<major>
? Something else?<prefix>/share/mongo-c-driver
. Same issue as above: Multiple major versions will fight over who owns this directory. Maybe tweak to<prefix>/share/mongo-c-driver/<verison>
?Footnotes
Names subject to bikeshedding. ↩